<!DOCTYPE html>
<html lang="en" class="is-centered is-bold">
<head>
    <meta charset="utf-8">
    <title>零基础</title>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="__STATIC__/css/bootstrap.css">
    <link rel="stylesheet" href="__STATIC__/css/bootstrap-datetimepicker.css" >
    <!-- 引入时间插件 -->
    <script src="__STATIC__/js/jquery.min.js"></script>
    <script src="__STATIC__/js/moment.min.js"></script>
    <script src="__STATIC__/js/bootstrap.min.js"></script>
	<script src="__STATIC__/js/moment-with-locales.js"></script>
    <script src="__STATIC__/js/bootstrap-datetimepicker.js"></script>
</head>
<body>
<div class="container" style="padding-top: 20px">
    <div class="col-sm-8">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">编辑图书</h3>
            </div>
            <div class="panel-body">
                <form class="form-horizontal" role="form" method="POST" action="updatebook">
                    <input type="hidden" name="id" value="{$data.id}">
                    <div class="row">
                        <div class="col-md-8">
                            <div class="form-group">
                                <label for="name" class="col-md-2 control-label">
                                    名称
                                </label>
                                <div class="col-md-10">
                                    <input type="text" class="form-control" name="name" id="name" value="{$data.name}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="name" class="col-md-2 control-label">
                                    分类
                                </label>
                                <div class="col-md-10">
                                    <select class="form-control" name="category">
                                        <option value="{$data.category}">{$data.category}</option>
                                        <option value="PHP"></option>
                                        <option value="Java" >Java</option>
                                        <option value="C++">C++</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="price" class="col-sm-2 control-label">
                                    价格
                                </label>
                                <div class="col-md-10">
                                    <input type="text" class="form-control" name="price" id="price" value="{$data.price}">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">出版时间</label>
                                <div class='col-md-10' >
                                    <div class='input-group date' id='publish_time'>
                                        <input type='text' class="form-control" name="publish_time" value="{$data.publish_time}"/>
                                        <span class="input-group-addon">
                                            <span class="glyphicon glyphicon-calendar"></span>
                                        </span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-8">
                        <div class="form-group">
                            <div class="col-md-10 col-md-offset-2">
                                <button type="submit" class="btn btn-primary btn-lg">
                                    <i class="fa fa-disk-o"></i>
                                    提交
                                </button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<script>
    //datetimepicker日期插件，获取日期
    $('#publish_time').datetimepicker({
        format: "Y-MM-DD",
		locale: moment.locale('zh-cn')
    });
</script>
</body>
</html>

